<?php

if(! defined('OT_ROOT')) {
	exit('Access Denied');
}


class AppXcxBabyFeed{
	public static $appName = '小程序宝宝喂养记录';
	public static $appID = 176;

	public static function Jud(){
		return false;
	}

	public static function Show($str, $def=''){
			return $def;
	}

	public static function TypeArr(){
		return array(
			array('type'=>'weinai',		'name'=>'喂奶',		'color'=>'#2979ff'),
			array('type'=>'fushi',		'name'=>'辅食',		'color'=>'#ff9900'),
			array('type'=>'niaobu',		'name'=>'尿布',		'color'=>'#00a68b'),
			array('type'=>'chiyao',		'name'=>'口服',		'color'=>'#aa359f'),
			array('type'=>'shuimian',	'name'=>'睡眠',		'color'=>'#47413c'),
			array('type'=>'xizao',		'name'=>'洗澡',		'color'=>'#463d9d'),
			array('type'=>'tiwen',		'name'=>'体温',		'color'=>'#be1919'),
			array('type'=>'dazhen',		'name'=>'打针',		'color'=>'#cb500a'),
			array('type'=>'yiyuan',		'name'=>'医院',		'color'=>'#702829'),
			array('type'=>'qita',		'name'=>'其他',		'color'=>'#0b6bb5')
			);
	}

	public static function TypeOption($def=''){
		$typeArr = self::TypeArr();

		$retStr = '';
		foreach ($typeArr as $val){
			$retStr .= '<option value="'. $val['type'] .'" '. Is::Selected($val['type'], $def) .'>'. $val['name'] .'</option>';
		}
		return $retStr;
	}

	public static function TypeItem($str, $type='name'){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				if ($type == 'nameColor'){
					return '<span style="color:'. $val['color'] .';">'. $val['name'] .'</span>';
				}else{
					if (! in_array($type, array('name','color'))){ $type = 'name'; }
					return $val[$type];
				}
			}
		}
		return '['. $str .','. $type .']';
	}

	public static function TypeJud($str){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				return true;
			}
		}
		return false;
	}

	public static function List(){
		$dataArr	= array('res' => false, 'note' => '', 'size' => 0, 'page' => 0, 'pageCount' => 0, 'count' => 0, 'dataCount' => 0, 'data' => array());
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['size']	= 0;
		$dataArr['page']	= 0;

		die( json_encode($dataArr) );
	}

	public static function Send(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Deal(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Del(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');

		die( json_encode($dataArr) );
	}
}
?>